﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <script src="Scripts/jquery-1.6.1.min.js" type="text/javascript"></script>
    <script src="Scripts/MathML.js" type="text/javascript"></script>
    <script src="Scripts/MathMLEditor.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(function () {
            $("#btnFS").click(function () {
                if (currentSelectedObj == undefined) {
                    alert("未指定位置");
                    return;
                }
                var fracHtml = "<span math='frac' mathroot='true'><span></span><span>□</span><span>□</span></span>";
                if (cursorDir == 0) {
                    currentSelectedObj.prepend(fracHtml);
                }
                else if (cursorDir == 1) {
                    currentSelectedObj.append(fracHtml);
                }
                //currentSelectedObj.append(fracHtml);
                $("span[mathroot='true']").each(function () {
                    $(this).formula();
                });
            });
        })
    </script>
</head>
<body>
<input id="btnFS" type="button" value="插入分数" /><br />
    测试测试测试测试<span>□</span>测试测试测试测试<br />
</body>
</html>
